package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.SmsFlashPromotionProductRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface SmsFlashPromotionProductRelationMapper extends BaseMapper<SmsFlashPromotionProductRelation> {
    @Select("SELECT flash_promotion_session_id,count(flash_promotion_session_id) " +
            "FROM sms_flash_promotion_product_relation WHERE flash_promotion_id=#{flashPromotionId}\n" +
            "GROUP BY flash_promotion_session_id")
    Map<Long,Long> selectCount(@Param("flash_promotion_id")Integer flashPromotionId);
}
